@import "../../sass/themes/base";

@import "../../sass/themes/popup";

@import "../../sass/mixins/compatible";

$popup-prefix: #{'.'+$css-prefix}popup;

#{$popup-prefix}-wrap,
#{$popup-prefix}-mask{
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

#{$popup-prefix}-mask{
  background-color: rgba(0,0,0,.65);
  height: 100%;
  opacity: 0;
  display: none;
}

#{$popup-prefix}-loading-wrap{
  #{$popup-prefix}-mask{
    background-color: rgba(255,255,255,.65);
  }
  #{$popup-prefix}-mask,
  #{$popup-prefix}-wrap{
    position: absolute;
  }
  #{$popup-prefix}{
    background-color: transparent;
    top: 50%;
    margin-top: -15px;
    &-body{
      padding: 0;
      line-height: 26px;
      text-align: center;
      [class*='icon']{
        color: $info-color;
        font-size: 26px;
      }
    }
  }
}

#{$popup-prefix}-msg-wrap {
  #{$popup-prefix}{
    background-color: rgba(0,0,0,.6);
    text-align: center;
    color: #fff;

  }
}


#{$popup-prefix}-mask-hidden{
  display: block;
  opacity: 1;
  @include transition(all .3s ease-out);
}

#{$popup-prefix}-wrap{
  overflow: auto;
  opacity: 0;
  @include transform(translate(0, -100%));
  @include transition(all .3s ease-out);
}
#{$popup-prefix}-info-wrap,
#{$popup-prefix}-success-wrap,
#{$popup-prefix}-error-wrap,
#{$popup-prefix}-warning-wrap,
#{$popup-prefix}-confirm-wrap{
  #{$popup-prefix}-body{
    padding: 32px 32px 24px;
  }
}

#{$popup-prefix}{
  position: relative;
  top: 30px;
  max-width: 80%;
  margin: 0 auto 24px;
  background-color: #fff;
  border-radius: $border-radius/2;
  &-close{
    position: absolute;
    top: 0;
    right: 0;
    width: $header-height + 1px;
    height: $header-height + 1px;
    text-align: center;
    line-height: $header-height + 1px;
    cursor: pointer;
    [class*="icon"]{
      font-size: 26px;
      color: $lightGray;
      transition: color .5s;
    }
    &:hover{
      [class*="icon"] {
        color: $darker;
      }
    }
  }
  &-close-no-title{
    width: 26px;
    height: 26px;
    line-height: 26px;
  }
  &-header{
    padding: $headerPadding;
    line-height: $header-height;
    font-size: 16px;
    border-bottom: 1px solid $border-color-default;
  }
  &-body{
    padding: $bodyPadding;
    line-height: 22px;
  }
  &-footer{
    padding: $footerPadding;
    text-align: right;
    border-top: 1px solid $border-color-default;
    [class*="button"]{
      margin-left: 10px;
    }
  }

  &-info,
  &-success,
  &-error,
  &-warning,
  &-confirm{
    &-body{
      > [class*='#{$css-prefix}icon']{
        color: $warning-color;
        font-size: 22px;
        margin-right: 16px;
        float: left;
      }
    }
    &-title{
      display: block;
      line-height: 22px;
      font-size: 16px;
      font-weight: 500;
    }
    &-content{
      margin-left: 38px;
      margin-top: 8px;
      color: $gray;
      font-size: 14px;
    }
    &-buttons{
      text-align: right;
      margin-top: 24px;
      [class*="button"]{
        margin-left: 10px;
      }
    }
  }

  &-info{
    &-body{
      > [class*='#{$css-prefix}icon']{
        color: $info-color;
      }
    }
  }

  &-success{
    &-body{
      > [class*='#{$css-prefix}icon']{
        color: $success-color;
      }
    }
  }

  &-error{
    &-body{
      > [class*='#{$css-prefix}icon']{
        color: $danger-color;
      }
    }
  }

  &-warning{
    &-body{
      > [class*='#{$css-prefix}icon']{
        color: $warning-color;
      }
    }
  }
}

#{$popup-prefix}-active{
  opacity: 1;
  @include transform(translate(0, 0));
  @include transition(all .3s ease-out);
}